<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">
<head>
<title>留学信息</title>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE10" />
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="css/bootstrap.min.css" />
<link rel="stylesheet" href="css/bootstrap-responsive.min.css" />
<link rel="stylesheet" href="css/matrix-style.css" />
<link rel="stylesheet" href="css/matrix-media.css" />
<link rel="stylesheet" href="jquery-easyui/themes/default/easyui.css" />
<link rel="stylesheet" href="jquery-easyui/themes/icon.css" />
<script type="text/javascript" src="jquery-easyui/jquery.min.js"></script>
<script type="text/javascript" src="jquery-easyui/jquery.easyui.min.js"></script>
<script charset="utf-8" src="editor/kindeditor-all.js"></script>
<script charset="utf-8" src="editor/lang/zh-CN.js"></script>
<link rel="stylesheet" href="editor/themes/default/default.css"></link>
<script type="text/javascript" src="editor/plugins/code/prettify.js"></script>
<style>
 .content-header{
/*   margin-top:-38px;
 */  font-size:16px;
  background-color:#fff;
 }
 .content-header table{
  font-weight:bolder;
  margin-left:30px;
 }
 .content-header .header-number{
  margin-left:10px;
 }
 div.span4{
 }
  .shift{
  float:left;
  font-size:20px;
  padding-right:20px;
  
 } 
 /*easyui*/
#fm {
	margin: 0;
	padding: 10px 30px;
}

.ftitle {
	font-size: 14px;
	font-weight: bold;
	padding: 5px 0;
	margin-bottom: 10px;
	border-bottom: 1px solid #ccc;
}

.fitem {
	margin-bottom: 5px;
}

.fitem label {
	display: inline-block;
	width: 80px;
}

.fitem input {
	width: 160px;
} 
</style>
<script type="text/javascript">

$(document).ready(function(){
	 $.ajax({
			url:"<%=request.getContextPath()%>/task?method=taskcount",
			dataType:'json',
			type:'post',
			data:{},
			beforeSend:function(){
				
			},
			success:function(result){
				if(result.success){
					$("#count").text(result.count);
				}
			}
		})
	 $.ajax({
			url:"<%=request.getContextPath()%>/study?method=majors",
			dataType:'json',
			type:'post',
			data:{},
			beforeSend:function(){
				
			},
			success:function(result){
				if(result.majors!=null){
					var str='';
					$.each(result.majors,function(i,item){
						str+='<li class="easyui-linkbutton l-btn l-btn-small l-btn-plain" data-options="plain:true" style="display:block;" onclick="reloadDgBy1()" group="" id=""><span class="l-btn-left"><span class="l-btn-text">'+item[0]+'</span></span></li>';
					})
					$("#master").append(str);
	    			rightAttr();
				}
			}
		})	
		
	$('#dg').datagrid({
		    title:'大学',
	        width:'100%',
		    pagination:true,
		    rownumbers:true,
		    fitColumns:true,
		    singleSelect:true,
		    idField:'id',
		    onClickCell: onClickCell,
		    onAfterEdit:onAfterEdit,
		    url:'<%=request.getContextPath()%>/study?method=list',
		    columns:[[
		        {field:'id',title:'编号',width:'20%',hidden:true},
		        {field:'name',title:'学校名称',width:'50%' },
		        {field:'rank',title:'学校排名',width:'45%',editor:'numberbox'
		         }
		    ]],
		});

	$('#dg2').datagrid({
		    title:'中学',
	        width:'100%',
		    pagination:true,
		    rownumbers:true,
		    fitColumns:true,
		    singleSelect:true,
		    idField:'id',
		    url:'<%=request.getContextPath()%>/study?method=list-mid',
		    columns:[[
		        {field:'id',title:'编号',width:'20%',hidden:true},
		        {field:'name',title:'学校名称',width:'95%',
			    
			     styler:function(index,row,value){
			    	 return 'text-align:center';
			     }
			    },
		    ]],
		});
	
	$('#dg3').datagrid({
		    title:'兼职',
	        width:'100%',
		    pagination:true,
		    rownumbers:true,
		    fitColumns:true,
		    singleSelect:true,
		    idField:'id',
		    url:'<%=request.getContextPath()%>/study?method=listpartjob',
		    columns:[[
		        {field:'id',title:'编号',hidden:true},
		        {field:'title',title:'标题',width:'50%' },
		        {field:'content',title:'内容',hidden:true},
		        {field:'date',title:'发布时间',width:'45%'}
		       
		    ]],
		 onClickRow: function (index, row) {//点击事件
			
	     }
		});
	
	
	$('#dg4').datagrid({
		    title:'留学信息',
	        width:'100%',
		    pagination:true,
		    rownumbers:true,
		    fitColumns:true,
		    singleSelect:true,
		    idField:'id',
		    url:'<%=request.getContextPath()%>/study?method=liststudy',
		    columns:[[
		        {field:'id',title:'编号',hidden:true},
		        {field:'title',title:'标题',width:'50%' },
		        {field:'content',title:'内容',hidden:true},
		        {field:'date',title:'发布时间',width:'45%'}
		       
		    ]],

		});
	
	//显示applyStep的内容
	$.ajax({
		url:'<%=request.getContextPath()%>/study?method=applylist',
		dataType:'json',
		type:'post',
		data:{},
		beforeSubmit:function(){
			
		},
		success:function(result){
			$("#append1").append(result.content);
			
		}
	})
		//显示签证的内容
	$.ajax({
		url:'<%=request.getContextPath()%>/study?method=metriallist',
		dataType:'json',
		type:'post',
		data:{},
		beforeSubmit:function(){
			
		},
		success:function(result){
			$("#append2").append(result.content);
			
		}
	})
	
	//top menu
	var ddlMenu1 = $('#li1').menubutton({ menu: '#cusmenu1' }); 
	var ddlMenu2 = $('#li2').menubutton({ menu: '#cusmenu2' }); 

	//menubutton 依赖于 menu、linkbutton 这两个插件，所以我们可以这样搞定她
	$(ddlMenu1.menubutton('options').menu).menu({
        onClick: function (item) {
        	if(item.id=='id1'){
        		
        	}else if(item.id=='id2'){
                window.open("<%=request.getContextPath()%>/task?method=assisttasks","_blank")

        	}else if(item.id=='id3'){
                window.open("<%=request.getContextPath()%>/","_self");

        	}
        }
	});
	$(ddlMenu2.menubutton('options').menu).menu({
	            onClick: function (item) {
	            	 if(item.id=='id4'){
	            	}
	            }
	});
	
	
	
})
</script>
<script>
function logout(){
		$.messager.confirm('Confirm','Are you sure you want to logout?',function(r){
            if (r){
                $.post('<%=request.getContextPath()%>/logout',function(result) {
					if (result.success) {
						$.messager.show({ // show error message
							title : '提示',
							msg : '退出成功'
						});
			           }
				 else {
						$.messager.show({ // show error message
									title : '提示',
									msg : '登录已过期，重新登录'
								});
					   }
				}, 'json');
    			window.open('<%=request.getContextPath()%>/index.jsp','_self');

		     }
	});
}
function profile(){
	window.open('<%=request.getContextPath()%>/profile?method=page','_self');
}
function gohome(){
	window.open('<%=request.getContextPath()%>/dashboard','_self');
}
</script>
<script>
 function insertSchool(){
	 $('#dlg').dialog('open').dialog('setTitle','导入');
	
 }
 KindEditor.ready(function(K) {
		var editor = K.editor({
			resizeType: 1,
			fullscreenMode: 0, //是否全屏显示
			designMode: 1,
			uploadJson:'editor/jsp/upload_json.jsp',
		    fileManagerJson : 'editor/jsp/file_manager_json.jsp',
			allowPreviewEmoticons: false,
			allowImageUpload: true,
			allowFileManager: true
		});
		K('#insertfile').click(function() {
			editor.loadPlugin('insertfile', function() {
				editor.plugin.fileDialog({
					clickFn : function(url, title) {
						editor.hideDialog();
					}
				});
			});
		});
	}); 
function doinsert(){
	$.ajax({
		url:'<%=request.getContextPath()%>/study?method=addschool',
		dataType:'json',
		type:'post',
		data:{},
		beforeSubmit:function(){
			
		},
		success:function(result){
			if(result.success){
				$.messager.show({
					title:'提示',
					msg:'批量插入成功'
				})
				$("#dlg").dialog('close');
				$("#dg").datagrid('reload');
			}else{
				$.messager.show({
					title:'提示',
					msg:'没有导入成功或者导入没有完全成功，检查您的表格之后重新导入'
				})
			}
			
		}
	})
} 
function check(content){
	window.open(content,'_blank');
	
}
function deleteSchool(){
	$.messager.confirm('Confirm','Are you sure you want to clear all schools?',function(r){
        if (r){
            $.post('<%=request.getContextPath()%>/study?method=delete',function(result) {
				if (result.success) {
			      $.messager.show({
			    	  title:'提示',
			    	  msg:'删除成功'
			      });
			      $("#dg").datagrid('reload');
	            }else{
	            	$.messager.show({
	            		title:'提示',
	            		msg:'删除失败'
	            	})
	            }
            },'json');
       }
});
}
function showRank(){
	var row=$("#dg").datagrid('getSelected');
	if(row){
		$('#dlg2').dialog("open").dialog('setTitle','专业排名');
	}
	
}
/*----------------------------------------------------------*/
 function insertMidSchool(){
	 $('#dlg3').dialog('open').dialog('setTitle','导入');
	
 }
 KindEditor.ready(function(K) {
		var editor = K.editor({
			resizeType: 1,
			fullscreenMode: 0, //是否全屏显示
			designMode: 1,
			uploadJson:'editor/jsp/upload_json.jsp',
		    fileManagerJson : 'editor/jsp/file_manager_json.jsp',
			allowPreviewEmoticons: false,
			allowImageUpload: true,
			allowFileManager: true
		});
		K('#insertfile2').click(function() {
			editor.loadPlugin('insertfile', function() {
				editor.plugin.fileDialog({
					clickFn : function(url, title) {
						editor.hideDialog();
					}
				});
			});
		});
	}); 
 function doinsertMid(){
		$.ajax({
			url:'<%=request.getContextPath()%>/study?method=add-mid',
			dataType:'json',
			type:'post',
			data:{},
			beforeSubmit:function(){
				
			},
			success:function(result){
				if(result.success){
					$.messager.show({
						title:'提示',
						msg:'批量插入成功'
					})
					$("#dlg3").dialog('close');
					$("#dg2").datagrid('reload');
				}else{
					$.messager.show({
						title:'提示',
						msg:'没有导入成功或者导入没有完全成功，检查您的表格之后重新导入'
					})
				}
				
			}
		})
 }
 function deleteMidSchool(){
		$.messager.confirm('Confirm','Are you sure you want to clear all middle schools?',function(r){
	        if (r){
	            $.post('<%=request.getContextPath()%>/study?method=delete-mid',function(result) {
					if (result.success) {
				      $.messager.show({
				    	  title:'提示',
				    	  msg:'删除成功'
				      });
				      $("#dg2").datagrid('reload');
		            }else{
		            	$.messager.show({
		            		title:'提示',
		            		msg:'删除失败'
		            	})
		            }
	            },'json');
	       }
	});
 }
 /* 大学申请流程*/
 function publishApply(){
	 $("#dlg4").dialog('open').dialog('setTitle','发布申请流程');
	  KindEditor.create("#editor_id4",{
			 cssPath:'editor/plugins/code/prettify.css',
	 		 resize:0,
			 uploadJson:'editor/jsp/upload_json.jsp',
		     fileManagerJson : 'editor/jsp/file_manager_json.jsp',
			 allowPreviewEmoticons:true,
			 allowImageUpload:true,			
			 width:'100%',
			 afterBlur:function() {
			      this.sync();
			  }
			 }) ; 
	  $("#fm4").form('clear');
	  url="<%=request.getContextPath()%>/study?method=publishstep";
 }
 
 function updateApply(){
	 $("#dlg4").dialog('open').dialog('setTitle','发布申请流程');
	  KindEditor.create("#editor_id4",{
			 cssPath:'editor/plugins/code/prettify.css',
	 		 resize:0,
			 uploadJson:'editor/jsp/upload_json.jsp',
		     fileManagerJson : 'editor/jsp/file_manager_json.jsp',
			 allowPreviewEmoticons:true,
			 allowImageUpload:true,			
			 width:'100%',
			 afterBlur:function() {
			      this.sync();
			  }
			 }) ; 
	  KindEditor.insertHtml('textarea[id="editor_id4"]',$("#append1").text());
 }
 
 function dopublishStep(){
	 $.ajax({
		 url:'<%=request.getContextPath()%>/study?method=publishstep',
		dataType:'json',
		type:'post',
		data:{content:$("#editor_id4").val()},
		beforeSubmit:function(){
			
		},
		success:function(result){
			if(result.success){
				$.messager.show({
					title:'提示',
					msg:'发布成功'
				})
	        	 $("#dlg4").dialog('close');

			}else{
				$.messager.show({
					title:'提示',
					msg:'发布失败'
					
				})
			}
			
		}
	 })
 }
 function deleteApplyStep(){
	 $.messager.confirm('Confirm','Are you sure you want to delete it?',function(r){
	        if (r){
	            $.post('<%=request.getContextPath()%>/study?method=deleteapply',function(result) {
					if (result.success) {
				      $.messager.show({
				    	  title:'提示',
				    	  msg:'删除成功'
				      });
				      var current_tab = $('#tab').tabs('getSelected');
			        	 $('#tab').tabs('update',{
			        		 tab:current_tab,
			        		 options:{
			        		 }
			        	 });
			        	 current_tab.panel('refresh');
		            }else{
		            	$.messager.show({
		            		title:'提示',
		            		msg:'删除失败'
		            	})
		            }
	            },'json');
	       }
	});
 }
 
 /* 签证材料  */
function publishMetrial(){
	 $("#dlg5").dialog('open').dialog('setTitle','发布签证材料');
	  KindEditor.create("#editor_id5",{
			 cssPath:'editor/plugins/code/prettify.css',
	 		 resize:0,
			 uploadJson:'editor/jsp/upload_json.jsp',
		     fileManagerJson : 'editor/jsp/file_manager_json.jsp',
			 allowPreviewEmoticons:true,
			 allowImageUpload:true,			
			 width:'100%',
			 afterBlur:function() {
			      this.sync();
			  }
			 }) ; 
	  $("#fm5").form('clear');
	  url="<%=request.getContextPath()%>/study?method=publishmetrial";
	  
 }
function updateMetrial(){
	 $("#dlg5").dialog('open').dialog('setTitle','签证需要材料');
	  KindEditor.create("#editor_id5",{
			 cssPath:'editor/plugins/code/prettify.css',
	 		 resize:0,
			 uploadJson:'editor/jsp/upload_json.jsp',
		     fileManagerJson : 'editor/jsp/file_manager_json.jsp',
			 allowPreviewEmoticons:true,
			 allowImageUpload:true,			
			 width:'100%',
			 afterBlur:function() {
			      this.sync();
			  }
			 }) ; 
	  KindEditor.insertHtml('textarea[id="editor_id5"]',$("#append2").text());
}

function dopublishMetrial(){
	 $.ajax({
		 url:'<%=request.getContextPath()%>/study?method=publishmetrial',
		dataType:'json',
		type:'post',
		data:{content:$("#editor_id5").val()},
		beforeSubmit:function(){
			
		},
		success:function(result){
			if(result.success){
				$.messager.show({
					title:'提示',
					msg:'发布成功'
				})
	        	 $("#dlg5").dialog('close');

			}else{
				$.messager.show({
					title:'提示',
					msg:'发布失败'
					
				})
			}
			
		}
	 })
}
function deleteApplyMetrial(){
	 $.messager.confirm('Confirm','Are you sure you want to delete it?',function(r){
	        if (r){
	            $.post('<%=request.getContextPath()%>/study?method=deletemetrial',function(result) {
					if (result.success) {
				      $.messager.show({
				    	  title:'提示',
				    	  msg:'删除成功'
				      });
				      var tab=$("#tab").tabs('getSelected');
				      tab.panel('open').panel('refresh');
				    
		            }else{
		            	$.messager.show({
		            		title:'提示',
		            		msg:'删除失败'
		            	})
		            }
	            },'json');
	       }
	});
}

/*-----------兼职信息-------*/
  function newPartjob(){
	 $("#dlg6").dialog('open').dialog('setTitle','发布兼职信息');
	 $('#fm6').form('clear');
	 KindEditor.html('#editor_id6','');
     KindEditor.create("#editor_id6",{
		 cssPath:'editor/plugins/code/prettify.css',
 		 resize:0,
		 uploadJson:'editor/jsp/upload_json.jsp',
	     fileManagerJson : 'editor/jsp/file_manager_json.jsp',
		 allowPreviewEmoticons:true,
		 allowImageUpload:true,			
		 width:'100%',
		 afterBlur:function() {
		      this.sync();
		  }
		 }) ;
	 url="<%=request.getContextPath()%>/study?method=addpartjob";
 }
  function doaddPartjob(){
		
		 $('#fm6').form('submit',{
			 url:url,
			 onSubmit:function(){
			 },
			 success:function(result){
				var result = eval('('+result+')');
	            if (!result.success){
	                $.messager.show({
	                    title: 'Error',
	                    msg: "发布失败"
	                    
	                });
	            } else {
	            	 $.messager.show({
	                     title: 'success',
	                     msg: "发布成功"
	                 });
	                $('#dlg6').dialog('close');        // close the dialog
	                $('#dg3').datagrid('reload');    // reload the user data
	            }
			 }
		 })
	 }
  function editPartJob(){
	  KindEditor.create("#editor_id7",{
			 cssPath:'editor/plugins/code/prettify.css',
	 		 resize:0,
			 uploadJson:'editor/jsp/upload_json.jsp',
		     fileManagerJson : 'editor/jsp/file_manager_json.jsp',
			 allowPreviewEmoticons:true,
			 allowImageUpload:true,			
			 width:'100%',
			 afterBlur:function() {
			      this.sync();
			  }
			 }) ;
		 var rows=$("#dg3").datagrid("getSelections");
		 if(rows.length==1){
			 $("#dlg7").dialog('open').dialog('setTitle','编辑活动'); 
			 $('#fm7').form('load',rows[0]);
			 KindEditor.html('#editor_id7',rows[0].content);
			 url="<%=request.getContextPath()%>/study?method=editpartjob&id="+rows[0].id;
		 }else if(rows.length>1){
			 $.messager.show({
				 title:'提示',
				 msg:'只能选中一个操作'
			 })
		 }
	 }
  function doeditPartjob(){
	  $("#fm7").form('submit',{
			 url:url,
			 onSubmit:function(){

			 },
			 success:function(result){
				var result = eval('('+result+')');
				 if (!result.success){
		                $.messager.show({
		                    title: 'Error',
		                    msg: "修改失败"
		                });
		            } else {
		            	 $.messager.show({
		                     title: 'success',
		                     msg: "修改成功"
		                 });
		                $('#dlg7').dialog('close');        // close the dialog
		                $('#dg3').datagrid('reload');    // reload the user data
		            }
			 }
		 })
  }
  function deletePartJob(){
		 var rows=$("#dg3").datagrid("getSelections");
		 if(rows.length==1){
			 $.messager.confirm('Confirm','Are you sure delete the partjob information?',function(r){
				 if(r){
					 $.post('<%=request.getContextPath()%>/study?method=deletepartjob&id='+rows[0].id,function(result){
						 if(result.success){
							 $.messager.show({
								 title:'提示',
								 msg:'删除成功'
							 });
							 $("#dg3").datagrid('reload');
						 }else{
							 $.messager.show({
								 title:'提示',
								 msg:'删除失败'
							 })
						 }
					 },'json');
				 }
			 })
		 }else if(rows.length>1){
			 $.messager.show({
				 title:'提示',
				 msg:'选中一个删除'
			 })
		 }
	 }
  function readPartJob(){
		 var rows=$("#dg3").datagrid('getSelections');
		 if(rows.length==1){
			 $("#dlg8").dialog('open').dialog('setTitle','兼职详情');
		     $("#content8").html(rows[0].content);
		 }else if(rows.length>1){
			 $.messager.show({
				 title:'提示',
				 msg:'选中一个操作'
			 })
		 }
	 }
  
  /*-----------------留学信息发布--------------------*/
   function newStudy(){
	 $("#dlg9").dialog('open').dialog('setTitle','发布留学信息');
	 $('#fm9').form('clear');
	 KindEditor.html("#editor_id9",'');
     KindEditor.create("#editor_id9",{
		 cssPath:'editor/plugins/code/prettify.css',
 		 resize:0,
		 uploadJson:'editor/jsp/upload_json.jsp',
	     fileManagerJson : 'editor/jsp/file_manager_json.jsp',
		 allowPreviewEmoticons:true,
		 allowImageUpload:true,			
		 width:'100%',
		 afterBlur:function() {
		      this.sync();
		  }
		 }) ;
	
	 url="<%=request.getContextPath()%>/study?method=addstudy";
 }
  
  function doaddStudy(){
		
		 $('#fm9').form('submit',{
			 url:url,
			 onSubmit:function(){
			 },
			 success:function(result){
				var result = eval('('+result+')');
	            if (!result.success){
	                $.messager.show({
	                    title: 'Error',
	                    msg: "发布失败"
	                    
	                });
	            } else {
	            	 $.messager.show({
	                     title: 'success',
	                     msg: "发布成功"
	                 });
	                $('#dlg9').dialog('close');        // close the dialog
	                $('#dg4').datagrid('reload');    // reload the user data
	            }
			 }
		 })
	 }
  function editStudy(){
	  KindEditor.create("#editor_id10",{
			 cssPath:'editor/plugins/code/prettify.css',
	 		 resize:0,
			 uploadJson:'editor/jsp/upload_json.jsp',
		     fileManagerJson : 'editor/jsp/file_manager_json.jsp',
			 allowPreviewEmoticons:true,
			 allowImageUpload:true,			
			 width:'100%',
			 afterBlur:function() {
			      this.sync();
			  }
			 }) ;
		 var rows=$("#dg4").datagrid("getSelections");
		 if(rows.length==1){
			 $("#dlg10").dialog('open').dialog('setTitle','编辑留学信息'); 
			 $('#fm10').form('load',rows[0]);
			 KindEditor.html('#editor_id10',rows[0].content);
			 url="<%=request.getContextPath()%>/study?method=editstudy&id="+rows[0].id;
		 }else if(rows.length>1){
			 $.messager.show({
				 title:'提示',
				 msg:'只能选中一个操作'
			 })
		 }
		 
	 }
  function doeditStudy(){
	  $("#fm10").form('submit',{
			 url:url,
			 onSubmit:function(){

			 },
			 success:function(result){
				var result = eval('('+result+')');
				 if (!result.success){
		                $.messager.show({
		                    title: 'Error',
		                    msg: "修改失败"
		                });
		            } else {
		            	 $.messager.show({
		                     title: 'success',
		                     msg: "修改成功"
		                 });
		                $('#dlg10').dialog('close');        // close the dialog
		                $('#dg4').datagrid('reload');    // reload the user data
		            }
			 }
		 })
  }
  
  function deleteStudy(){
		 var rows=$("#dg4").datagrid("getSelections");
		 if(rows.length==1){
			 $.messager.confirm('Confirm','Are you sure delete the abroad study information?',function(r){
				 if(r){
					 $.post('<%=request.getContextPath()%>/study?method=deletestudy&id='+rows[0].id,function(result){
						 if(result.success){
							 $.messager.show({
								 title:'提示',
								 msg:'删除成功'
							 });
							 $("#dg4").datagrid('reload');
						 }else{
							 $.messager.show({
								 title:'提示',
								 msg:'删除失败'
							 })
						 }
					 },'json');
				 }
			 })
		 }else if(rows.length>1){
			 $.messager.show({
				 title:'提示',
				 msg:'选中一个删除'
			 })
		 }
		
	 }
  
  function readStudy(){
		 var rows=$("#dg4").datagrid('getSelections');
		 if(rows.length==1){
			 $("#dlg11").dialog('open').dialog('setTitle','留学信息详情');
		     $("#content11").html(rows[0].content);
		 }else if(rows.length>1){
			 $.messager.show({
				 title:'提示',
				 msg:'选中一个操作'
			 })
		 }
	 }
  function gotoMytask(){
		window.open('<%=request.getContextPath()%>/task','_self');
	}
  </script>
  
<script type="text/javascript">
var editIndex = undefined;
function endEditing() {//该方法用于关闭上一个焦点的editing状态
	if (editIndex == undefined) {
		return true
	}
	if ($('#dg').datagrid('validateRow', editIndex)) {
		$('#dg').datagrid('endEdit', editIndex);
		editIndex = undefined;
		return true;
	} else {
		return false;
	}
}
//点击单元格事件：
function onClickCell(index,field,value) {

	if (endEditing()) {
		if(field!="id"&&field!="name"){
			$(this).datagrid('beginEdit', index);
			var ed = $(this).datagrid('getEditor', {index:index,field:field});
			$(ed.target).focus();
		}		
		editIndex = index;
	}
/* 	$('#dg').datagrid('onClickRow',function(){
		$('#dg').datagrid('endEdit', editIndex);
	}) */
	
}
//单元格失去焦点执行的方法
function onAfterEdit(index, row, changes) {
	var updated = $('#dg').datagrid('getChanges', 'updated');
	if (updated.length < 1) {
		editRow = undefined;
		$('#dg').datagrid('unselectAll');
		return;
	} else {
		// 传值
		submitForm(index, row, changes);
	}
}
//提交数据
function submitForm(index, row, changes) {
	var id=row.id;
	var field= $('#dg').datagrid('getColumnFields')[2];
	var col = $('#dg').datagrid( "getColumnOption" , field );
	var value=changes.rank;
	$.ajax({
		    dataType:'json',
			type : "post",
			url : "<%=request.getContextPath()%>/study?method=updaterank",
			data : {
				id:id,
				fieldname:col.title,
				value:value
			},
			beforeSend:function(){
				
			},
			success : function(result) {
				if(result.success){
					$.messager.show({
						title:'提示',
						msg:'成功'
						
					})
					$("#dg").datagrid('reload');
				}
			}
		})
}
</script>
<script>
/*----------------------------重写大学tab ----------------------------*/

function addSchool(){
    $('#dlg12').dialog('open').dialog('setTitle','add school');
    KindEditor.create("#editor_id12",{
		 cssPath:'editor/plugins/code/prettify.css',
 		 resize:0,
		 uploadJson:'editor/jsp/upload_json.jsp',
	     fileManagerJson : 'editor/jsp/file_manager_json.jsp',
		 allowPreviewEmoticons:true,
		 allowImageUpload:true,			
		 width:'100%',
		 items:[''],
		 afterBlur:function() {
		      this.sync();
		  }
		 }) ; 
   
    $('#fm12').form('clear');
    KindEditor.html('#editor_id12','');
}

function doAdd(){
	$("#fm12").form('submit',{
		url:"<%=request.getContextPath()%>/study?method=addcollege",
		onSubmit:function(){
			if($("#editor_id12").val()==""){
				$.messager.show({
					title:'提示',
					msg:'学校介绍不能为空'
					
				})
				return false;
			}			
			if(!$("#fm12").form('validate')){
				return false;
			}
		},
		success:function(result){
			var result=eval('('+result+')');
			if(result.success){
				$.messager.show({
					title:'提示',
					msg:'成功'
				})
				$("#dlg12").dialog("close");
				$("#dg").datagrid('reload');
				
			}
		}
	})
}


function editSchool(){
	var row=$("#dg").datagrid('getSelected');
   if(row){
	   $('#dlg13').dialog('open').dialog('setTitle','edit school');
	    KindEditor.create("#editor_id13",{
			 cssPath:'editor/plugins/code/prettify.css',
	 		 resize:0,
			 uploadJson:'editor/jsp/upload_json.jsp',
		     fileManagerJson : 'editor/jsp/file_manager_json.jsp',
			 allowPreviewEmoticons:true,
			 allowImageUpload:true,			
			 width:'100%',
			 items:[''],
			 afterBlur:function() {
			      this.sync();
			  }
			 }) ; 
	   
	    $('#fm13').form('load',row);
	    KindEditor.html('#editor_id13',row.content);
	    url="<%=request.getContextPath()%>/study?method=editcollege&id="+row.id;
   }
}

function doEdit(){
	$("#fm13").form('submit',{
		url:url,
		onSubmit:function(){
			if($("#editor_id13").val()==""){
				$.messager.show({
					title:'提示',
					msg:'学校介绍不能为空'
					
				})
				return false;
			}			
			if(!$("#fm13").form('validate')){
				return false;
			}
		},
		success:function(result){
			var result=eval('('+result+')');
			if(result.success){
				$.messager.show({
					title:'提示',
					msg:'成功'
				})
				$("#dlg13").dialog("close");
				$("#dg").datagrid('reload');
				
			}
		}
	})
}

function deleteCollege(){
	 var row=$("#dg").datagrid("getSelected");
     if(row){
    	 $.messager.confirm('Confirm','Are you sure delete the college?',function(r){
    		 if(r){
    			 $.post('<%=request.getContextPath()%>/study?method=deletecollege&id='+row.id,function(result){
    				 if(result.success){
    					 $.messager.show({
    						 title:'提示',
    						 msg:'删除成功'
    					 })
    					 $("#dg").datagrid('reload');
    				 }else{
    					 $.messager.show({
    						 title:'提示',
    						 msg:'删除失败'
    					 })
    				 }
    			 },'json');
    		 }
    	 })
     }
	
}
function showSchool(){
	var row=$("#dg").datagrid('getSelected');
	if(row){
		$("#dlg14").dialog('open').dialog('setTitle','大学介绍');
		$("#college-content").html(row.content);
	}
	
}
/************************重写中学******************************/
function addMidschool(){
    $('#dlg15').dialog('open').dialog('setTitle','add mid school');
    KindEditor.create("#editor_id15",{
		 cssPath:'editor/plugins/code/prettify.css',
 		 resize:0,
		 uploadJson:'editor/jsp/upload_json.jsp',
	     fileManagerJson : 'editor/jsp/file_manager_json.jsp',
		 allowPreviewEmoticons:true,
		 allowImageUpload:true,			
		 width:'100%',
		 items:[''],
		 afterBlur:function() {
		      this.sync();
		  }
		 }) ; 
   
    $('#fm15').form('clear');
    KindEditor.html('#editor_id15','');
}

function doAddmid(){
	$("#fm15").form('submit',{
		url:"<%=request.getContextPath()%>/study?method=addmid",
		onSubmit:function(){
			if($("#editor_id15").val()==""){
				$.messager.show({
					title:'提示',
					msg:'学校介绍不能为空'
					
				})
				return false;
			}			
			if(!$("#fm15").form('validate')){
				return false;
			}
		},
		success:function(result){
			var result=eval('('+result+')');
			if(result.success){
				$.messager.show({
					title:'提示',
					msg:'成功'
				})
				$("#dlg15").dialog("close");
				$("#dg2").datagrid('reload');
				
			}
		}
	})
}


function editMidschool(){
	var row=$("#dg2").datagrid('getSelected');
   if(row){
	   $('#dlg16').dialog('open').dialog('setTitle','edit school');
	    KindEditor.create("#editor_id16",{
			 cssPath:'editor/plugins/code/prettify.css',
	 		 resize:0,
			 uploadJson:'editor/jsp/upload_json.jsp',
		     fileManagerJson : 'editor/jsp/file_manager_json.jsp',
			 allowPreviewEmoticons:true,
			 allowImageUpload:true,			
			 width:'100%',
			 items:[''],
			 afterBlur:function() {
			      this.sync();
			  }
			 }) ; 
	   
	    $('#fm16').form('load',row);
	    KindEditor.html('#editor_id16',row.content);
	    url="<%=request.getContextPath()%>/study?method=editmid&id="+row.id;
   }
}

function doEditmid(){
	$("#fm16").form('submit',{
		url:url,
		onSubmit:function(){
			if($("#editor_id16").val()==""){
				$.messager.show({
					title:'提示',
					msg:'学校介绍不能为空'
					
				})
				return false;
			}			
			if(!$("#fm16").form('validate')){
				return false;
			}
		},
		success:function(result){
			var result=eval('('+result+')');
			if(result.success){
				$.messager.show({
					title:'提示',
					msg:'成功'
				})
				$("#dlg16").dialog("close");
				$("#dg2").datagrid('reload');
				
			}
		}
	})
}

function deleteMid(){
	 var row=$("#dg2").datagrid("getSelected");
     if(row){
    	 $.messager.confirm('Confirm','Are you sure delete the mid school?',function(r){
    		 if(r){
    			 $.post('<%=request.getContextPath()%>/study?method=deletemid&id='+row.id,function(result){
    				 if(result.success){
    					 $.messager.show({
    						 title:'提示',
    						 msg:'删除成功'
    					 })
    					 $("#dg2").datagrid('reload');
    				 }else{
    					 $.messager.show({
    						 title:'提示',
    						 msg:'删除失败'
    					 })
    				 }
    			 },'json');
    		 }
    	 })
     }
	
}
function showMidschool(){
	var row=$("#dg2").datagrid('getSelected');
	if(row){
		$("#dlg17").dialog('open').dialog('setTitle','中学介绍');
		$("#mid-content").html(row.content);
	}
	
}


/*增加专业类别*/
function addLi(){
	$.messager.prompt('Prompt', 'Please enter the new major type:', function(r){
		if (r){
			 $.ajax({
					url:"<%=request.getContextPath()%>/study?method=addmajor",
					dataType:'json',
					type:'post',
					data:{name:r},
					beforeSend:function(){
						var str="";
						$("#master").find('li').each(function(){
							str+=$(this).text();
						})
						if(str.indexOf(r)>-1){
							$.messager.show({
								title:'提示',
								msg:'不能创建重名专业'
							})
							return false;
						}
					},
					success:function(result){
						if(result.success){
			    			 var str='<li class="easyui-linkbutton l-btn l-btn-small l-btn-plain" data-options="plain:true" style="display:block;" onclick="reloadDgBy1()" group="" id=""><span class="l-btn-left"><span class="l-btn-text">'+r+'</span></span></li>';
			    			   $("#master").append(str);
			    				rightAttr();
			    		}else{
			    			$.messager.show({
			    				title:"error",
			    				msg:'失败'
			    			})
			    		}
					}
				})
		}
	});
}

/*给专业类别绑定邮件属性，点击事件*/
function rightAttr(){
	$("#master").find('li').each(function(){
		//右键属性
		$(this).bind('contextmenu',function(e){
			e.preventDefault();
			$("#master").find('li').each(function(){
				$(this).attr('getSelected','');
			})
			$(this).attr('getSelected','true');
			$('#mm').menu('show', {
				left: e.pageX,
				top: e.pageY
			});
 	});
		$(this).click(function(){
			$('#dg').datagrid({
				    title:'大学',
			        width:'100%',
				    pagination:true,
				    rownumbers:true,
				    fitColumns:true,
				    singleSelect:true,
				    idField:'id',
				    onClickCell: onClickCell,
				    onAfterEdit:onAfterEdit,
				    url:'<%=request.getContextPath()%>/study?method=rank&fieldname='+$(this).text(),
				    columns:[[
				        {field:'id',title:'编号',width:'20%',hidden:true},
				        {field:'name',title:'学校名称',width:'50%' },
				        {field:'rank',title:$(this).text(),width:'45%',editor:'numberbox'
				         }
				    ]],
				});
		})
})
}
function deleteMaster(){
    var li=$("#master").find('li[getselected="true"]');
	 $.messager.confirm('Confirm','Are you sure delete?',function(r){
		 if(r){
			 $.ajax({
			    	url:"<%=request.getContextPath()%>/study?method=deletemajor",
			    	dataType:'json',
			    	type:'post',
			    	data:{name:li.text()},
			    	beforeSend:function(){
			    		
			    	},
			    	success:function(result){
			    		if(result.success){
			    			li.remove();
			    			$.messager.show({
			    				title:'提示',
			    				msg:'成功'
			    				
			    			})
			    		}else{
			    			$.messager.show({
			    				title:'提示',
			    				msg:'删除失败'
			    			})
			    		}
			    	}
		 })
	 }
    })

}
function editMaster(){
    var li=$("#master").find('li[getselected="true"]');
    $.messager.prompt('Prompt', 'edit the name', function(r){
		if (r){
			$.ajax({
				url:"<%=request.getContextPath()%>/study?method=majorname",
			    type:'post',
			    dataType:'json',
			    data:{oldname:li.text(),newname:r},
			    beforeSend:function(){
			    	
			    },
			    success:function(result){
			    	if(result.success){
			  		  li.linkbutton({text:r});
			    	}
			    	
			    }
			})
		}
	});
}

function reloadDgBy0(){
	$('#dg').datagrid({
		    title:'大学',
	        width:'100%',
		    pagination:true,
		    rownumbers:true,
		    fitColumns:true,
		    singleSelect:true,
		    idField:'id',
		    onClickCell: onClickCell,
		    onAfterEdit:onAfterEdit,
		    url:'<%=request.getContextPath()%>/study?method=list',
		    columns:[[
		        {field:'id',title:'编号',width:'20%',hidden:true},
		        {field:'name',title:'学校名称',width:'50%' },
		        {field:'rank',title:'学校排名',width:'45%',editor:'numberbox'
		         }
		    ]],
		});
}

</script>
</head>
<body>

<!--Header-part-->
<div id="header">
  <h1><a href="dashboard.html">Matrix Admin</a></h1>
</div>
<!--close-Header-part--> 

<!-- header menu -->
<ul style="position:absolute;left:200px;top:20px;list-style:none;">

 <li id="li2" style="float:left;padding:5px;color:#0094ff;font-size:12px;" icon="icon-lightning" onclick="gohome()">首页</li>
</ul>
<!-- header menu -->
<!-- header menu -->
<div id="welcome" >
<h3 style="position:absolute;top:5px;right:30px;font-size:16px;height:35px;line-height:32px;background:white;border-radius:10px 10px">
<a href="#" onclick="gotoMytask()"><span style="padding:5px;border-radius:10px 10px ;color:white;background:red;" id="count"></span></a>

<a href="#" class="easyui-menubutton" data-options="menu:'#mm5',iconCls:'icon-man'" style="color:#0094ff;">${sessionScope.assist.id }</a>
</h3>
</div>
<div id="mm5" style="width:150px;">
		<div data-options="iconCls:'icon-undo'" onclick="profile()">个人设置</div>
		<div class="menu-sep"></div>
		<div>我的任务</div>
		<div class="menu-sep"></div>
		<div>系统消息</div>
		<div class="menu-sep"></div>
		<div onclick="logout()">安全退出</div>
</div>
<!-- side bar start -->
<div id="sidebar" ><a href="#" class="visible-phone"><i class="icon icon-home"></i> Dashboard2</a>
  <ul>
    <li ><a  href="<%=request.getContextPath()%>/dashboard"><i class="icon icon-home"></i> <span>Dashboard控制面板</span></a> </li>
    <li class="active"> <a href="<%=request.getContextPath()%>/study?method=page"><i class="icon icon-signal"></i> <span>Study news留学信息</span></a> </li>
    <li> <a href="<%=request.getContextPath()%>/travel?method=page"><i class="icon icon-inbox"></i> <span>Travel New活动信息</span></a> </li>
    <li><a href="<%=request.getContextPath()%>/news?method=page"><i class="icon icon-th"></i> <span>Recent News近期新闻</span></a></li>
    <li><a href="<%=request.getContextPath()%>/member?method=page"><i class="icon icon-fullscreen"></i> <span>Members centre会员中心</span></a></li>
    <c:choose>
     <c:when test="${sessionScope.assist.type eq 0}">
      <li  ><a href="<%=request.getContextPath() %>/assist"><i class="icon icon-th-list"></i> <span>助理管理</span></a></li>
     </c:when>
    </c:choose>
    <li><a href="<%=request.getContextPath() %>/task"><i class="icon icon-th-list"></i> <span>任务管理</span></a></li>
  </ul>
</div>
<div id="content" style="background:#eee;">
<div class="easyui-tabs" id="tab"  fit="true" style="width:100%;background: #eee;">
		<div title="英国大学介绍" style="padding:10px;width:100%;height:100%;" class="easyui-layout">
		<div region="east"  split="true" style="width: 300px;">
		    <ul style="margin-top:10px;">
		     <li class="easyui-linkbutton" data-options="plain:true" style="display:block;" onclick="reloadDgBy0()">学校排名</li>
		    </ul>
		    <hr/>
	      <ul id="master">专业排名<span iconCls="icon-add" class="easyui-linkbutton" plain='true' onclick="addLi()"></span>
	      </ul>
		 <div id="mm" class="easyui-menu"  style="width:120px;">
			<div data-options="name:'edit'"  onclick="editMaster()">编辑</div>
			<div data-options="name:'delete'" onclick="deleteMaster()">删除</div>
		</div>
		</div>
		<div region="center" style="padding: 0px; background: #eee;">
		 <table id="dg" toolbar="#toolbar"></table>
		 <div id="toolbar">
		        <a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="addSchool()">添加学校 </a>
				<a href="#" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="editSchool()">编辑学校</a>
				<a href="#" class="easyui-linkbutton" iconCls="icon-remove" plain='true' onclick="deleteCollege()">删除学校</a>
				<a href="#" class="easyui-linkbutton" iconCls="icon-large-smartart" plain='true' onclick="showSchool()">学校详情</a>
				<!-- <a href="#" class="easyui-linkbutton" iconCls="icon-add"
					plain="true" onclick="insertSchool()">批量导入数据</a> <a href="#"
					class="easyui-linkbutton" iconCls="icon-remove" plain="true"
					onclick="deleteSchool()">清空数据</a> <a href="#"
					class="easyui-linkbutton" iconCls="icon-large-smartart" plain="true"
					onclick="showRank()">学校各专业排名</a> -->
		 </div>
	<!-- 	<div id="dlg" class="easyui-dialog"
				style="width:600px; height: 600px; padding: 10px 20px"
				closed="true" buttons="#dlg-buttons">
				<form id="fm" method="post"  novalidate></form>
				<div class="ftitle" style="text-align: center;">批量导入数据</div>
				<div>
				<h5>Excel文件请符合以下标准：</h5>
				<p>后缀名为xls</p>
                <p>数据请勿放在合并的单元格中</p>
                <h5>导入步骤：</h5>
				<p>第一步，下载学校导入模板；<a href="/attached/template.xls" style="color:blue;">导入模板</a></p>
				<p>第二步，上传excel数据表格；</p>
				<p>第三步，导入结束后，会显示导入结果，如有导入失败的数据，系统会返回excel文件，可下载查看导入失败的原因。</p>
				<h5>注意事项：</h5>
				<p>不要修改excel文件名,不要修改excel内容文件结构</p>
				</div>
				<hr>导入excel
				<div style="border:1px dotted gray;text-align:center;padding:20px;">
				<input type="button" id="insertfile" value="上传excel文件" />
				</div>
			</div>
			<div id="dlg-buttons">
				<a href="javascript:void(0)" class="easyui-linkbutton c6"
					iconCls="icon-ok" onclick="doinsert()" style="width: 90px">导入数据</a> <a
					href="javascript:void(0)" class="easyui-linkbutton"
					iconCls="icon-cancel"
					onclick="javascript:$('#dlg').dialog('close')" style="width: 90px">Cancel</a>
			</div>
			<div id="dlg2" class="easyui-dialog"
				style="width:600px; height: 600px; padding: 10px 20px"
				closed="true" buttons="#dlg-buttons2">
				<div class="ftitle" style="text-align: center;">该学校各专业排名</div>
				<table class="table table-bordered table-striped">
				<tr><td>商科排名</td><td></td></tr>
			    <tr><td>艺术排名 </td><td></td></tr>
			    <tr><td>工程排名</td><td></td></tr>
				</table>
			</div>
			<div id="dlg-buttons2">
				 <a href="javascript:void(0)" class="easyui-linkbutton"
					iconCls="icon-cancel"
					onclick="javascript:$('#dlg2').dialog('close')" style="width: 90px">Cancel</a>
			</div> -->
		</div>
		</div>
		<div title="英国中学介绍"  style='bacckground:#eee;'>
		 <table id="dg2" toolbar="#toolbar2"></table>
		  <div id="toolbar2">
		        <a href="#" class="easyui-linkbutton" iconCls="icon-add" plain='true' onclick="addMidschool()">添加学校</a>
   		        <a href="#" class="easyui-linkbutton" iconCls="icon-edit" plain='true' onclick="editMidschool()">编辑学校</a>
   		        <a href="#" class="easyui-linkbutton" iconCls="icon-remove" plain='true' onclick="deleteMid()">删除学校</a>
   		        <a href="#" class="easyui-linkbutton" iconCls="icon-large-smartart" plain='true'  onclick="showMidschool()">学校介绍</a>
		        
				<!-- <a href="#" class="easyui-linkbutton" iconCls="icon-add"
					plain="true" onclick="insertMidSchool()">批量导入数据</a> <a href="#"
					class="easyui-linkbutton" iconCls="icon-remove" plain="true"
					onclick="deleteMidSchool()">清空数据</a> -->
		</div>
<!-- 		<div id="dlg3" class="easyui-dialog"
				style="width:600px; height: 600px; padding: 10px 20px"
				closed="true" buttons="#dlg-buttons3">
				<form id="fm" method="post"  novalidate></form>
				<div class="ftitle" style="text-align: center;">批量导入数据</div>
				<div>
				<h5>Excel文件请符合以下标准：</h5>
				<p>后缀名为xls</p>
                <p>数据请勿放在合并的单元格中</p>
                <h5>导入步骤：</h5>
				<p>第一步，下载学校导入模板；<a href="/attached/midschool-template.xls" style="color:blue;">导入模板</a></p>
				<p>第二步，上传excel数据表格；</p>
				<p>第三步，导入结束后，会显示导入结果，如有导入失败的数据，系统会返回excel文件，可下载查看导入失败的原因。</p>
				<h5>注意事项：</h5>
				<p>不要修改excel文件名,不要修改excel内容文件结构</p>
				</div>
				<hr>导入excel
				<div style="border:1px dotted gray;text-align:center;padding:20px;">
				<input type="button" id="insertfile2" value="上传excel文件" />
				</div>
			</div>
			<div id="dlg-buttons3">
				<a href="javascript:void(0)" class="easyui-linkbutton c6"
					iconCls="icon-ok" onclick="doinsertMid()" style="width: 90px">导入数据</a> <a
					href="javascript:void(0)" class="easyui-linkbutton"
					iconCls="icon-cancel"
					onclick="javascript:$('#dlg3').dialog('close')" style="width: 90px">Cancel</a>
			</div> -->
		</div>
		<div title="大学申请流程" style="padding:10px">
		    <div id="display">
		     	<a href="#" class="easyui-linkbutton" iconCls="icon-add"
					plain="true" onclick="publishApply()">发布申请流程</a> <a href="#"
					class="easyui-linkbutton" iconCls="icon-edit" plain="true"
					onclick="updateApply()">修改申请流程</a> <a
					href="#" class="easyui-linkbutton" iconCls="icon-remove" plain="true"
					onclick="deleteApplyStep()">删除</a>
					<hr/>
			   <div id="append1"></div>
		    </div>
		    <div id="dlg4" class="easyui-dialog"
				style="width:600px; height: 600px; padding: 10px 20px"
				closed="true" buttons="#dlg-buttons4">
				<div class="ftitle" style="text-align: center;">大学申请流程</div>
				<form id="fm4" method="post" novalidate>
					<div class="fitem">
					   <textarea style="float:left;"  class="easyui-kindeditor " id="editor_id4" name="content"   required="true"></textarea>
					</div>
				</form>
			</div>
			<div id="dlg-buttons4">
				<a href="javascript:void(0)" class="easyui-linkbutton c6"
					iconCls="icon-ok" onclick="dopublishStep()" style="width: 90px">Save</a> <a
					href="javascript:void(0)" class="easyui-linkbutton"
					iconCls="icon-cancel"
					onclick="javascript:$('#dlg4').dialog('close')" style="width: 90px">Cancel</a>
			</div>
			
		</div>
		<div title="学生签证所需材料"  style="padding:10px">
			<div>
			 <a href="#" class="easyui-linkbutton" iconCls="icon-add"
					plain="true" onclick="publishMetrial()">发布</a> <a href="#"
					class="easyui-linkbutton" iconCls="icon-edit" plain="true"
					onclick="updateMetrial()">修改</a> <a
					href="#" class="easyui-linkbutton" iconCls="icon-remove" plain="true"
					onclick="deleteApplyMetrial()">删除</a>
					<hr/>
				<div id='append2'></div>
			</div>
			<div id="dlg5" class="easyui-dialog"
				style="width:600px; height: 600px; padding: 10px 20px"
				closed="true" buttons="#dlg-buttons5">
				<div class="ftitle" style="text-align: center;">签证所需材料</div>
				<form id="fm5" method="post" novalidate>
					<div class="fitem">
					   <textarea style="float:left;"  class="easyui-kindeditor " id="editor_id5" name="content"   required="true"></textarea>
					</div>
				</form>
			</div>
			<div id="dlg-buttons5">
				<a href="javascript:void(0)" class="easyui-linkbutton c6"
					iconCls="icon-ok" onclick="dopublishMetrial()" style="width: 90px">Save</a> <a
					href="javascript:void(0)" class="easyui-linkbutton"
					iconCls="icon-cancel"
					onclick="javascript:$('#dlg5').dialog('close')" style="width: 90px">Cancel</a>
			</div>
		</div>		
		<div title="兼职信息发布" >
			<table id="dg3"  toolbar="#toolbar3"></table>
			<div id="toolbar3">
				<a href="#" class="easyui-linkbutton" iconCls="icon-add"
					plain="true" onclick="newPartjob()">发布兼职信息</a> <a href="#"
					class="easyui-linkbutton" iconCls="icon-edit" plain="true"
					onclick="editPartJob()">修改</a> <a href="#"
					class="easyui-linkbutton" iconCls="icon-remove" plain="true"
					onclick="deletePartJob()">删除</a> <a
					href="#" class="easyui-linkbutton" iconCls="icon-large-smartart" plain="true"
					onclick="readPartJob()">查看详情</a>
		   </div>
		   
		   <div id="dlg6" class="easyui-dialog"
				style="width:900px; height: 600px; padding: 10px 20px"
				closed="true" buttons="#dlg-buttons6">
				<div class="ftitle" style="text-align: center;">发布兼职信息</div>
				<form id="fm6" method="post" novalidate>
					<div class="fitem">
						<label>标题:</label> <input name="title" class="easyui-textbox"
							required="true"  style="width:300px">
					</div>
					<div class="fitem">
						<label>活动内容:</label>
					   <textarea style="float:left;"  class="easyui-kindeditor " id="editor_id6" name="content"   required="true"></textarea>
					</div>
				</form>
			</div>
			<div id="dlg-buttons6">
				<a href="javascript:void(0)" class="easyui-linkbutton c6"
					iconCls="icon-ok" onclick="doaddPartjob()" style="width: 90px">Save</a> <a
					href="javascript:void(0)" class="easyui-linkbutton"
					iconCls="icon-cancel"
					onclick="javascript:$('#dlg6').dialog('close')" style="width: 90px">Cancel</a>
			</div>
			
			  
		   <div id="dlg7" class="easyui-dialog"
				style="width:900px; height: 600px; padding: 10px 20px"
				closed="true" buttons="#dlg-buttons7">
				<div class="ftitle" style="text-align: center;">编辑兼职信息</div>
				<form id="fm7" method="post" novalidate>
					<div class="fitem">
						<label>标题:</label> <input name="title" class="easyui-textbox"
							required="true"  style="width:300px">
					</div>
					<div class="fitem">
						<label>活动内容:</label>
					   <textarea style="float:left;"  class="easyui-kindeditor " id="editor_id7" name="content"   required="true"></textarea>
					</div>
				</form>
			</div>
			<div id="dlg-buttons7">
				<a href="javascript:void(0)" class="easyui-linkbutton c6"
					iconCls="icon-ok" onclick="doeditPartjob()" style="width: 90px">Save</a> <a
					href="javascript:void(0)" class="easyui-linkbutton"
					iconCls="icon-cancel"
					onclick="javascript:$('#dlg7').dialog('close')" style="width: 90px">Cancel</a>
			</div>
			
			<div id="dlg8" class="easyui-dialog"
				style="width:600px; height: 400px; padding: 10px 20px"
				closed="true" buttons="#dlg-buttons8">
				<div id="content8"></div>
			</div>
		</div>
	    <div title="留学信息发布"  >
    			<table id="dg4"  toolbar="#toolbar4"></table>
    			<div id="toolbar4">
					<a href="#" class="easyui-linkbutton" iconCls="icon-add"
					plain="true" onclick="newStudy()">发布留学信息</a> <a href="#"
					class="easyui-linkbutton" iconCls="icon-edit" plain="true"
					onclick="editStudy()">修改</a> <a href="#"
					class="easyui-linkbutton" iconCls="icon-remove" plain="true"
					onclick="deleteStudy()">删除</a> <a
					href="#" class="easyui-linkbutton" iconCls="icon-large-smartart" plain="true"
					onclick="readStudy()">查看详情</a>
		        </div>
		        
		        
		         <div id="dlg9" class="easyui-dialog"
				style="width:900px; height: 600px; padding: 10px 20px"
				closed="true" buttons="#dlg-buttons9">
				<div class="ftitle" style="text-align: center;">发布留学信息</div>
				<form id="fm9" method="post" novalidate>
					<div class="fitem">
						<label>标题:</label> <input name="title" class="easyui-textbox"
							required="true"  style="width:300px">
					</div>
					<div class="fitem">
						<label>活动内容:</label>
					   <textarea style="float:left;"  class="easyui-kindeditor " id="editor_id9" name="content"   required="true"></textarea>
					</div>
				</form>
			</div>
			<div id="dlg-buttons9">
				<a href="javascript:void(0)" class="easyui-linkbutton c6"
					iconCls="icon-ok" onclick="doaddStudy()" style="width: 90px">Save</a> <a
					href="javascript:void(0)" class="easyui-linkbutton"
					iconCls="icon-cancel"
					onclick="javascript:$('#dlg9').dialog('close')" style="width: 90px">Cancel</a>
			</div>
			
			  
		   <div id="dlg10" class="easyui-dialog"
				style="width:900px; height: 600px; padding: 10px 20px"
				closed="true" buttons="#dlg-buttons10">
				<div class="ftitle" style="text-align: center;">编辑留学信息</div>
				<form id="fm10" method="post" novalidate>
					<div class="fitem">
						<label>标题:</label> <input name="title" class="easyui-textbox"
							required="true"  style="width:300px">
					</div>
					<div class="fitem">
						<label>活动内容:</label>
					   <textarea style="float:left;"  class="easyui-kindeditor" id="editor_id10" name="content"   required="true"></textarea>
					</div>
				</form>
			</div>
			<div id="dlg-buttons10">
				<a href="javascript:void(0)" class="easyui-linkbutton c6"
					iconCls="icon-ok" onclick="doeditStudy()" style="width: 90px">Save</a> <a
					href="javascript:void(0)" class="easyui-linkbutton"
					iconCls="icon-cancel"
					onclick="javascript:$('#dlg10').dialog('close')" style="width: 90px">Cancel</a>
			</div>
			
			<div id="dlg11" class="easyui-dialog"
				style="width:900px; height: 600px; padding: 10px 20px"
				closed="true" buttons="#dlg-buttons8">
				<div id="content11"></div>
			</div>
			<!-- 重写大学-->
			<div id="dlg12" class="easyui-dialog"
				style="width:600px; height: 600px; padding: 10px 20px"
				closed="true" buttons="#dlg-buttons12">
				<div class="ftitle" style="text-align: center;">添加大学</div>
			
				<form id="fm12" method="post" novalidate>
					<div class="fitem">
						<label>大学名称:</label> <input name="name"  id="name" class="easyui-textbox"
							required="true"  style="width:250px"  >
					</div>
					<div class="fitem">
						<label>学校介绍:</label>
					   <textarea style="float:left;"  name="content" class="easyui-validatebox" data-options="required:true" id="editor_id12" ></textarea>
					</div>
					<div class="fitem">
						<label>学校排名:</label> <input  style="width:250px" name="rank"  class="easyui-numberbox"
							required="true">
					</div>
				</form>
			</div>
			<div id="dlg-buttons12">
				<a href="javascript:void(0)" class="easyui-linkbutton c6"
					iconCls="icon-ok" onclick="doAdd()" style="width:90px">Save</a> <a
					href="javascript:void(0)" class="easyui-linkbutton"
					iconCls="icon-cancel"
					onclick="javascript:$('#dlg12').dialog('close')" style="width:90px">Cancel</a>
			</div>
			
			
			<div id="dlg13" class="easyui-dialog"
				style="width:600px; height: 600px; padding: 10px 20px"
				closed="true" buttons="#dlg-buttons13">
				<div class="ftitle" style="text-align: center;">编辑大学</div>
				<form id="fm13" method="post" novalidate>
					<div class="fitem">
						<label>大学名称:</label> <input name="name"  id="name" class="easyui-textbox"
							required="true"  style="width:250px"  >
					</div>
					<div class="fitem">
						<label>学校介绍:</label>
					   <textarea style="float:left;"  name="content" class="easyui-validatebox" data-options="required:true" id="editor_id13" ></textarea>
					</div>
					<div class="fitem">
						<label>学校排名:</label> <input  style="width:250px" name="rank"  class="easyui-numberbox"
							required="true">
					</div>
				</form>
			</div>
			<div id="dlg-buttons13">
				<a href="javascript:void(0)" class="easyui-linkbutton c6"
					iconCls="icon-ok" onclick="doEdit()" style="width:90px">Save</a> <a
					href="javascript:void(0)" class="easyui-linkbutton"
					iconCls="icon-cancel"
					onclick="javascript:$('#dlg13').dialog('close')" style="width:90px">Cancel</a>
			</div>
			
			<div id="dlg14" class="easyui-dialog"
				style="width:600px; height: 600px; padding: 10px 20px"
				closed="true" buttons="#dlg-buttons14">
				<div id="college-content"></div>
			</div>
			
			<!-- 重写中学 -->
			<div id="dlg15" class="easyui-dialog"
				style="width:600px; height: 600px; padding: 10px 20px"
				closed="true" buttons="#dlg-buttons15">
				<div class="ftitle" style="text-align: center;">添加中学</div>
			
				<form id="fm15" method="post" novalidate>
					<div class="fitem">
						<label>中学名称:</label> <input name="name"  id="name" class="easyui-textbox"
							required="true"  style="width:250px"  >
					</div>
					<div class="fitem">
						<label>学校介绍:</label>
					   <textarea style="float:left;"  name="content" class="easyui-validatebox" data-options="required:true" id="editor_id15" ></textarea>
					</div>
					
				</form>
			</div>
			<div id="dlg-buttons15">
				<a href="javascript:void(0)" class="easyui-linkbutton c6"
					iconCls="icon-ok" onclick="doAddmid()" style="width:90px">Save</a> <a
					href="javascript:void(0)" class="easyui-linkbutton"
					iconCls="icon-cancel"
					onclick="javascript:$('#dlg15').dialog('close')" style="width:90px">Cancel</a>
			</div>
			
			
			<div id="dlg16" class="easyui-dialog"
				style="width:600px; height: 600px; padding: 10px 20px"
				closed="true" buttons="#dlg-buttons16">
				<div class="ftitle" style="text-align: center;">编辑大学</div>
				<form id="fm16" method="post" novalidate>
					<div class="fitem">
						<label>大学名称:</label> <input name="name"  id="name" class="easyui-textbox"
							required="true"  style="width:250px"  >
					</div>
					<div class="fitem">
						<label>学校介绍:</label>
					   <textarea style="float:left;"  name="content" class="easyui-validatebox" data-options="required:true" id="editor_id16" ></textarea>
					</div>
					
				</form>
			</div>
			<div id="dlg-buttons16">
				<a href="javascript:void(0)" class="easyui-linkbutton c6"
					iconCls="icon-ok" onclick="doEditmid()" style="width:90px">Save</a> <a
					href="javascript:void(0)" class="easyui-linkbutton"
					iconCls="icon-cancel"
					onclick="javascript:$('#dlg16').dialog('close')" style="width:90px">Cancel</a>
			</div>
			
			<div id="dlg17" class="easyui-dialog"
				style="width:600px; height: 600px; padding: 10px 20px"
				closed="true" buttons="#dlg-buttons14">
				<div id="mid-content"></div>
			</div>
			
		</div>
	</div>
</div>
<!--Footer-part-->
<div class="row-fluid">
  <div id="footer" class="span12"> 2016 &copy; <a href="http://themedesigner.in/">guangzhoushuntian information technology</a> </div>
</div>
<!--end-Footer-part-->
</body>
</html>